<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix' => 'questions'], function () {
    Route::get('', '\App\Http\Controllers\QuestionController@index')->name('questions.index');
    Route::get('create', '\App\Http\Controllers\QuestionController@create')->name('questions.create');
    Route::post('', '\App\Http\Controllers\QuestionController@store')->name('questions.store');
    Route::post('confirm', '\App\Http\Controllers\QuestionController@confirm')->name('questions.confirm');
    Route::get('{id}', '\App\Http\Controllers\QuestionController@view')->name('questions.view')->where(['id' => '\d+']);
});

Route::group(['prefix' => 'words'], function () {
    Route::get('', '\App\Http\Controllers\WordController@index');
    Route::get('create', 'App\Http\Controllers\WordController@create')->name('words.create');
    Route::post('', 'App\Http\Controllers\WordController@store');
    Route::get('trans', '\App\Http\Controllers\WordController@trans');
});
